import socket;
import sys;


# 创建 socket 对象
serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM);
# 获取本地主机名
host = socket.gethostname();
# 设置端口号
port = 9999;
# 连接服务，指定主机和端口号
serversocket.connect((host, port));

# 接收大小1024 字节数据
msg = serversocket.recv(1024);

serversocket.close();

print(msg.decode('utf-8'));
